﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ViewActivities.aspx.cs" Inherits="services_ViewActivities" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<%@ Register Assembly="obout_Grid_NET" Namespace="Obout.Grid" TagPrefix="cc1" %>
<%@ Register TagPrefix="cc1" Namespace="Obout.Interface" Assembly="obout_Interface" %>
<%@ Register TagPrefix="oem" Namespace="OboutInc.EasyMenu_Pro" Assembly="obout_EasyMenu_Pro" %>
<%@ Register TagPrefix="obout" Namespace="OboutInc.Flyout2" Assembly="obout_Flyout2_NET"%>
<%@ Register src="../header.ascx" tagname="header" tagprefix="uc1" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Actividades en sitio</title>    
    <link href="../style/Style.css" rel="stylesheet" type="text/css" />
    <link href="../style/axesat.css" rel="stylesheet" type="text/css" />
    <link href="css/axesat.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="../js/jquery-1.2.6.pack.js"></script>

    <link href="../js/shadowbox/shadowbox.css" rel="stylesheet" type="text/css" />        
    <script src="../js/shadowbox/shadowbox.js" type="text/javascript"></script>        
    <script src="../js/Axesat.js" type="text/javascript"></script>

   
		<script type="text/javascript">
		    function exportToExcel() {
		        Grid1.exportToExcel();
		    }

		    function asignarColumnaSeleccionada(nombreColumna) {
		        document.getElementById('hdnColumnaSeleccionada').value = nombreColumna;
		    }

		    function nodoSeleccionado(idNodo) {
		        document.getElementById('hdnPostBackTree').value = '1';
		        document.getElementById('hdnNodoSeleccionado').value = idNodo;
		        document.forms[0].submit();
		    }

		    function rightClick(e) {		        
		        if (e.target)
		            document.getElementById('hdnRightClickSeleccionado').value = e.target.id;
		        else
		            document.getElementById('hdnRightClickSeleccionado').value = e.srcElement.id;
		        
		        // para parar la propagacion del evento en gecko
		        if (e.stopPropagation) {
		            e.preventDefault();
		            e.stopPropagation();
		        }
		        return false;
		    }
		    
		    

		    window.onload = function() {
		    html_el = document.getElementsByTagName('html').item(0);
		    if (window.attachEvent)
		        html_el.attachEvent('oncontextmenu', rightClick);
		    else if (window.addEventListener)
		        html_el.addEventListener('contextmenu', rightClick, false);		    
		    }


		    var arr_ob_t2_IndexedNodes = null, arr_ob_t2_NodesParents = null, arr_ob_t2_NodesLevels = null;
		    function ob_t2_ExpandCollapseLevel(iLevel, bType) {
		        // the first time the function is executed
		        // the levels of the nodes must be calculated
		        if (arr_ob_t2_NodesLevels == null) {
		            arr_ob_t2_IndexedNodes = new Array();
		            arr_ob_t2_NodesParents = new Array();
		            arr_ob_t2_NodesLevels = new Array();

		            var oTempNode = ob_getFirstNodeOfTree();
		            var oTempParent = null;
		            var i = 0;
		            while (oTempNode != null) {
		                arr_ob_t2_IndexedNodes[i] = oTempNode.id;

		                oTempParent = ob_getParentOfNode(oTempNode);
		                if (oTempParent) {
		                    arr_ob_t2_NodesParents[oTempNode.id] = oTempParent.id;
		                }
		                oTempNode = ob_getNodeDown(oTempNode, true);
		                i++;
		            }

		            for (i = 0; i < arr_ob_t2_IndexedNodes.length; i++) {
		                var iTempLevel = 0;
		                var sTempParent = arr_ob_t2_NodesParents[arr_ob_t2_IndexedNodes[i]];
		                while (sTempParent != null) {
		                    iTempLevel++;
		                    sTempParent = arr_ob_t2_NodesParents[sTempParent];
		                }
		                arr_ob_t2_NodesLevels[arr_ob_t2_IndexedNodes[i]] = iTempLevel;
		            }
		        }

		        for (var i = 0; i < arr_ob_t2_IndexedNodes.length; i++) {
		            if (arr_ob_t2_NodesLevels[arr_ob_t2_IndexedNodes[i]] == iLevel) {
		                oImg = document.getElementById(arr_ob_t2_IndexedNodes[i]).parentNode.firstChild.firstChild;
		                var lensrc = (oImg.src.length - 8);
		                var s = oImg.src.substr(lensrc, 8);
		                if (bType == true) {
		                    if ((s == "usik.gif") || (s == "ik_l.gif")) {
		                        oImg.onclick();
		                        //ob_t21(oImg, null);
		                    }
		                }
		                else if ((s == "inus.gif") || (s == "us_l.gif")) {
		                    oImg.onclick();
		                    //ob_t21(oImg, null);
		                }
		            }
		        }

		    }

		    function setFondoLinks() {
		        
		        var tipo = document.getElementById('hdnTipoActividad').value;
		        var liInst = document.getElementById('liInstalaciones');
		        var liTras = document.getElementById('liTraslados');
		        var liCanc = document.getElementById('liCancelaciones');
		        
		        
		        if (tipo == "Instalaciones") {
		            liInst.setAttribute("class", "overmenu");
		            liTras.setAttribute("class", "");
		            liCanc.setAttribute("class", ""); 
		        }
		        else if (tipo == "Traslados") {
		            liInst.setAttribute("class", "");
		            liTras.setAttribute("class", "overmenu");
		            liCanc.setAttribute("class", ""); 
		        }
		        else if (tipo == "Cancelaciones") {
		            liInst.setAttribute("class", "");
		            liTras.setAttribute("class", "");
		            liCanc.setAttribute("class", "overmenu"); 		        
		        }
		    }

		    function CursorMano(contenedor) {
		        contenedor.style.cursor = 'hand';
		        contenedor.style.cursor = 'pointer';
		    }

		    function stopRKey(evt) {
		        var evt = (evt) ? evt : ((event) ? event : null);
		        var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
		        if ((evt.keyCode == 13) && (node.type == "text")) { return false; }

		    }

		    function keyPressed(e, fuente) {
		        var unicode = e.keyCode ? e.keyCode : e.charCode
		        document.onkeypress = stopRKey;
		        if (unicode == 13) {
		            if (fuente == 1) {
		                var boton = document.getElementById('<%=btnSearchVisible.ClientID%>');
		                boton.click();
		            }
		            else {
		                var boton = document.getElementById('<%=btnBuscarGrilla.ClientID%>');
		                boton.click();
		            }
		        }
		    }
		       

		</script>					   
</head>
<body style="margin-left: 0px;" oncontextmenu="return false;" onload="ob_t2_ExpandCollapseLevel(1, false);setFondoLinks();">

    <form id="form1" runat="server">
      <ajaxToolkit:ToolkitScriptManager runat="Server" ID="ScriptManager1" />
    <div>
    
    <table width="95%">
    <tr>
        <td colspan="2">            
            <uc1:header ID="header1" runat="server" />
        </td>
    </tr>
    </table>
    
    <div id="content">
        <div class="tit_content">Gestión de actividades</div>
        <div id="bar_nav2">
            <div class="menusupe">
                <ul>
                    <li id="liInstalaciones">
                    <asp:LinkButton ID="lnkInstalaciones" runat="server" onclick="lnkInstalaciones_Click">Instalaciones</asp:LinkButton>  
                    </li>
                    <li id="liTraslados">
                    <asp:LinkButton ID="lnkTraslados" runat="server" onclick="lnkTraslados_Click">Traslados</asp:LinkButton> 
                    </li>
                    <li id="liCancelaciones">
                    <asp:LinkButton ID="lnkCancelaciones" runat="server" onclick="lnkCancelaciones_Click">Cancelaciones</asp:LinkButton> 
                    </li>
                </ul>
            </div>                                            
        </div>
        
    
    <!--menu-->
    <div id="menu_lateral">
       <asp:Panel ID="pnlTree" runat="server" CssClass="frameText" Height="135px" 
            Width="465px">
       <ASP:Literal id="trvClient" runat="server" />
       
        <center>
        <table runat="server" id="tblError" width="180px"><tr><td></td></tr>
        </table>
           </center>
                </asp:Panel>
        </div>                
    <!--menu-->                  

<div id="btn_descarga">
<img id="img1" alt="Exportar a excel" src="../images/btn_descargal.jpg" onclick="exportToExcel();return false;" style="cursor:pointer;" />
    <table background="../images/fondoFlyout.jpg" style="border: 1px solid Gray; background-repeat:repeat; z-index:100; ">
    <tr>
    <td>    
        Buscar:<asp:TextBox ID="txtSearchVisible" runat="server" Text="" onkeyup="keyPressed(event, 1);"></asp:TextBox>    
    </td>
    <td>             
        <asp:ImageButton ID="btnSearchVisible" ImageUrl="../images/view.gif" runat="server" 
            onclick="btnSearchVisible_Click" />        
        </td>
    </tr>    

    </table>

</div>
<div id="content_tabla">

        <asp:HiddenField ID="hdnColumnaSeleccionada" runat="server" />
        <asp:HiddenField ID="hdnNodoSeleccionado" runat="server" />
        <asp:HiddenField ID="hdnRightClickSeleccionado" runat="server" />
        <asp:HiddenField ID="hdnPostBackTree" runat="server" Value="0" />
        <asp:HiddenField ID="hdnTipoActividad" runat="server" Value="Instalaciones" />
        <asp:HiddenField ID="hdnNIT" runat="server" />
        <asp:HiddenField ID="hdnIdCuenta" runat="server" />
        <asp:HiddenField ID="hdnTipoCliente" runat="server" />
                
                <cc1:Grid ID="Grid1" runat="server" FolderStyle="styles/black_glass" AutoGenerateColumns="False" 
                    Serialize="false"
                    EnableTypeValidation="false" AllowAddingRecords="false" 
                    AllowFiltering="false" AllowSorting="false"
                    PageSize="6" AllowPageSizeSelection="false"
                    CallbackMode="true" GenerateRecordIds="true" 
                    AllowMultiRecordSelection="true" Width="950px" 
                onrowdatabound="Grid1_RowDataBound" >                    
                    <Columns>
                    <cc1:Column ID="Column4" DataField="nombre_servicio" runat="server" HeaderAlign="left" Wrap="true" Width="14%">
                        <TemplateSettings HeaderTemplateID="TemplateHeaderNombreServicio" />
                    </cc1:Column>
                    <cc1:Column ID="Column5" DataField="idservicio" runat="server" HeaderAlign="left" Visible="false" Width="7%">
                        <TemplateSettings HeaderTemplateID="TemplateHeaderIdServicio" />
                    </cc1:Column>                                        
                    <cc1:Column ID="Column2" DataField="numero_cpa" HeaderText="CPA" runat="server" HeaderAlign="left" Width="6%">                        
                        <TemplateSettings HeaderTemplateID="TemplateHeaderNumeroCPA" />
                    </cc1:Column>
                    <cc1:Column ID="Column6" DataField="velocidad" HeaderText="Velocidad" runat="server" HeaderAlign="left" Width="10%">                    
                        <TemplateSettings HeaderTemplateID="TemplateHeaderVelocidad" />
                    </cc1:Column>
                    <cc1:Column ID="Column3" DataField="tecnologia" HeaderText="Tecnología" runat="server" HeaderAlign="left" Width="10%">
                        <TemplateSettings HeaderTemplateID="TemplateHeaderTecnologia" />
                    </cc1:Column>
                    <cc1:Column ID="Column1" DataField="valor_producto" runat="server" HeaderAlign="left" Width="9%">
                        <TemplateSettings HeaderTemplateID="TemplateHeaderValorProducto" TemplateId="TemplateItemValorProducto" />
                    </cc1:Column>                    
                    <cc1:Column ID="Column17" DataField="fecha_preventa2" runat="server" Wrap="true" HeaderAlign="left" Width="13%">                    
                        <TemplateSettings HeaderTemplateID="TemplateHeaderFechaPreventa" />
                    </cc1:Column>
                    <cc1:Column ID="Column10" DataField="fecha_coordinada2" HeaderText="" runat="server" Wrap="true" HeaderAlign="left" Width="13%">
                        <TemplateSettings HeaderTemplateID="TemplateHeaderFechaCoordinada" />
                    </cc1:Column>
                    <cc1:Column ID="Column8" DataField="estado_servicio" HeaderText="Estado" runat="server" Wrap="true" HeaderAlign="left" Align="left" Width="11%">                         
                        <TemplateSettings HeaderTemplateID="TemplateHeaderEstado" />
                    </cc1:Column>                                                                                 
                    <cc1:Column ID="Column9" DataField="estado" HeaderText="Ver flujo" runat="server" HeaderAlign="left" Align="center" Width="7%"> 
                        <TemplateSettings TemplateId="TemplateItemEstado" HeaderTemplateId="TemplateHeaderVerFlujo" />
                    </cc1:Column>                    
                    <cc1:Column ID="Column7" DataField="idServicioSF" runat="server" Visible="false">                        
                    </cc1:Column>
                    </Columns>
                    
                    <ExportingSettings ExportDetails="True" />                    

                    <TemplateSettings RowEditTemplateId="tplRowEdit" />
                    <LocalizationSettings AddLink="Nuevo" CancelAllLink="Cancelar todo" 
                        CancelLink="Cancelar" DeleteLink="Eliminar" EditLink="Editar" 
                        Filter_ApplyLink="Aplicar Filtro" Filter_HideLink="Ocultar filtro" 
                        Filter_RemoveLink="Quitar filtro" Filter_ShowLink="Mostrar filtro" 
                        FilterCriteria_Contains="Contiene" FilterCriteria_DoesNotContain="No contiene" 
                        FilterCriteria_EndsWith="Termina con" FilterCriteria_EqualTo="Igual a" 
                        FilterCriteria_GreaterThan="Mayor a" 
                        FilterCriteria_GreaterThanOrEqualTo="Mayor o igual a" 
                        FilterCriteria_IsEmpty="Vacio" FilterCriteria_IsNotEmpty="No vacio" 
                        FilterCriteria_IsNotNull="No nulo" FilterCriteria_IsNull="Nulo" 
                        FilterCriteria_NoFilter="Sin filtro" FilterCriteria_NotEqualTo="Diferente a" 
                        FilterCriteria_SmallerThan="Menor que" 
                        FilterCriteria_SmallerThanOrEqualTo="Menor o igual a" 
                        FilterCriteria_StartsWith="Comienza con" 
                        Grouping_GroupInformationNextPage=" (Mostrando XXXXX de YYYYY registros - This group is continued on the next page)" 
                        Grouping_GroupInformationPreviousNextPage=" (Mostrando XXXXX de YYYYY registros - This group was started on the previous page and continues on the next page)" 
                        Grouping_GroupInformationPreviousPage=" (Mostrando XXXXX de YYYYY registros - This group was started on the previous page)" 
                        LoadingText="Cargando..." ModifyLink="Modificar" 
                        NoRecordsText="NO SE ENCONTRARON REGISTROS" 
                        Paging_ManualPagingLink="Ir a la pagina »" Paging_OfText="de" 
                        Paging_PageSizeText="Registros por pagina" Paging_PagesText="Paginas:" 
                        Paging_RecordsText="Registros:" RemoveLink="Quitar" SaveAllLink="Guardar todo" 
                        SaveLink="Guardar" UpdateLink="Actualizar" />
                    <Templates>
                        <cc1:GridTemplate runat="server" ID="TemplateHeaderNombreServicio">
                            <Template>                            
                                <div id="divHeaderFlyout1" onclick="asignarColumnaSeleccionada('nombre_servicio'); <%=Flyout1.getClientID()%>.AttachTo('divHeaderFlyout1'); <%=Flyout1.getClientID()%>.Open();">Nombre<br />Servicio</div>
                            </Template>
                        </cc1:GridTemplate>                            
                        <cc1:GridTemplate runat="server" ID="TemplateHeaderIdServicio">                        
                            <Template>
                                <div id="divHeaderFlyout2" onclick="asignarColumnaSeleccionada('idservicio');<%=Flyout1.getClientID()%>.AttachTo('divHeaderFlyout2'); <%=Flyout1.getClientID()%>.Open();">Id<br />Servicio</div>                                
                            </Template>
                        </cc1:GridTemplate>                                                    
                        <cc1:GridTemplate runat="server" ID="TemplateHeaderNumeroCPA">                        
                            <Template>
                                <div id="divHeaderFlyout3" onclick="asignarColumnaSeleccionada('numero_cpa'); <%=Flyout1.getClientID()%>.AttachTo('divHeaderFlyout3'); <%=Flyout1.getClientID()%>.Open();">CPA</div>
                            </Template>
                        </cc1:GridTemplate>                                                                            
                        <cc1:GridTemplate runat="server" ID="TemplateHeaderVelocidad">
                            <Template>
                                <div id="divHeaderFlyout4" onclick="asignarColumnaSeleccionada('velocidad'); <%=Flyout1.getClientID()%>.AttachTo('divHeaderFlyout4'); <%=Flyout1.getClientID()%>.Open();">Velocidad</div>
                            </Template>
                        </cc1:GridTemplate>                                                                                                    
                        <cc1:GridTemplate runat="server" ID="TemplateHeaderTecnologia">
                            <Template>
                                <div id="divHeaderFlyout5" onclick="asignarColumnaSeleccionada('tecnologia'); <%=Flyout1.getClientID()%>.AttachTo('divHeaderFlyout5');  <%=Flyout1.getClientID()%>.Open();">Tecnología</div>
                            </Template>
                        </cc1:GridTemplate>                        
                        <cc1:GridTemplate runat="server" ID="TemplateHeaderFechaPreventa">
                            <Template>
                                <div id="divHeaderFlyout6" onclick="asignarColumnaSeleccionada('fecha_preventa2'); <%=Flyout1.getClientID()%>.AttachTo('divHeaderFlyout6'); <%=Flyout1.getClientID()%>.Open();">Fecha<br />Preventa</div>                                
                            </Template>
                        </cc1:GridTemplate>   
                        <cc1:GridTemplate runat="server" ID="TemplateHeaderFechaCoordinada">
                            <Template>
                                <div id="divHeaderFlyout7" onclick="asignarColumnaSeleccionada('fecha_coordinada2'); <%=Flyout1.getClientID()%>.AttachTo('divHeaderFlyout7'); <%=Flyout1.getClientID()%>.Open();">Fecha<br />coordinada</div>
                            </Template>
                        </cc1:GridTemplate>  
                        <cc1:GridTemplate runat="server" ID="TemplateHeaderEstado">
                            <Template>
                                <div id="divHeaderFlyout8" onclick="asignarColumnaSeleccionada('estado_servicio'); <%=Flyout1.getClientID()%>.AttachTo('divHeaderFlyout8'); <%=Flyout1.getClientID()%>.Open();">Estado</div>
                            </Template>
                        </cc1:GridTemplate>                          
                        <cc1:GridTemplate runat="server" ID="TemplateHeaderVerFlujo">
                            <Template>
                                Ver<br />flujo</div>
                            </Template>
                        </cc1:GridTemplate>                                                                                   
                        <cc1:GridTemplate runat="server" ID="TemplateHeaderValorProducto">
                            <Template>
                                <div id="divHeaderFlyout9" onclick="asignarColumnaSeleccionada('valor_producto'); <%=Flyout1.getClientID()%>.AttachTo('divHeaderFlyout9'); <%=Flyout1.getClientID()%>.Open();">Valor</div>                                
                            </Template>
                        </cc1:GridTemplate>        
                        <cc1:GridTemplate runat="server" ID="TemplateItemValorProducto">
                            <Template>
                                <asp:Label ID="Label1" runat="server" 
                                Text='<%# Container.DataItem["valor_producto"] %>'></asp:Label>
                                <br />
                                <asp:Label ID="Label3" runat="server" Font-Bold="true" 
                                Text='<%# Container.DataItem["divisa"] %>'></asp:Label>                                
                            </Template>
                        </cc1:GridTemplate>        
        
                        <cc1:GridTemplate runat="server" ID="TemplateItemEstado">
                            <Template>
                                <asp:HyperLink ID="lnkEstado" runat="server"><img src="../images/ver_estado.jpg" alt="0" border="0" /></asp:HyperLink>
                            </Template>
                        </cc1:GridTemplate>                                                
        
                    </Templates>

                </cc1:Grid>
                
        
</div>
  </div>
          
    </div>

    
<obout:Flyout runat="server" ID="Flyout1" OpenEvent="NONE" CloseEvent="NONE" Position="BOTTOM_CENTER">
<div id="menu2">
<img src="../images/close.jpg" border="0" alt="Cerrar filtros" onclick="<%=Flyout1.getClientID()%>.Close();" style="float:right" />
<asp:LinkButton ID="lnkAscendente" runat="server" onclick="lnkAscendente_Click">Ordenar A - Z</asp:LinkButton><br />
<asp:LinkButton ID="lnkDescendente" runat="server" onclick="lnkDescendente_Click">Ordenar Z - A</asp:LinkButton><br /><br />
<hr/>
<div style="margin:4px 0 0 0; padding:0; float:left; width:140px">
  <a>Contiene</a></div>
  <div style="margin:4px 0 0 0; padding:0; float:left; width:140px">
  <asp:TextBox ID="txtContiene" runat="server" Width="90px" onkeyup="keyPressed(event, 2);"></asp:TextBox>&nbsp;<asp:ImageButton ID="btnBuscarGrilla" runat="server" ImageUrl="../images/view.gif" onclick="btnBuscarGrilla_Click" />
                </div>
  <div style="margin:4px 0 0 0; padding:0; float:left; width:140px">
  </div>
   <br /><br /> 
</div>
    
</obout:Flyout>			
    
<obout:Flyout runat="server" ID="Flyout2">
    <table background="../images/fondoFlyout.jpg" style="border: 1px solid Gray; background-repeat:repeat; z-index:100; ">
    <tr>
    <td>    
        <asp:TextBox ID="txtSearch" runat="server" Text=""></asp:TextBox>    
    </td>
    <td>             
        <asp:ImageButton ID="btnSearch" ImageUrl="../images/view.gif" runat="server" 
            onclick="btnSearch_Click" />        
        </td>
    </tr>    

    </table>
</obout:Flyout>    

    </form>
</body>
</html>

<style type="text/css">
    .ob_gNRM
    {
    	/*Para hacer mas grande el texto de no se encotnraron registros*/
        font-size:12px;
        font-weight:bold;
        
    }
</style>
